package com.demo.service;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

/**
 * @author wangzhanjin
 * @date 2018/6/13 20:04
 *
 */
@Component
public class MqTopicConsumerService {
    /**
     * 监听队列
     * 原本是监听类、队列目的地也就是destination
     */
    @JmsListener(destination = "my-topic",containerFactory = "myJmsContainerFactory")
    public void receiveTopic(String text) {
        System.out.println("接受到：" + text);
    }
}